import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@/assets/css/reset.css'
import './plugins/element.ts'
Vue.config.productionTip = false
import axios, { AxiosResponse, AxiosRequestConfig } from 'axios';
axios.interceptors.request.use(
  (config:AxiosRequestConfig)=> {
      config.withCredentials = false; // 允许携带token ,这个是解决跨域产生的相关问题
      config.headers.Authorization=window.sessionStorage.getItem("token");
      return config;
  },
  (error:any) => {
      return Promise.reject(error);
  }
);
axios.interceptors.response.use(
  (response:AxiosResponse) => {
      let info = response.data;
      return Promise.resolve(response);
  },
  (error:any) => {
      let errorInfo = error.response;
      return Promise.reject(errorInfo);
  }
);
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
